﻿using System;
using System.Collections.Generic;

namespace Torrenter.Common.Objects
{
    [Serializable]
    public class ShowSeason
    {
        public List<Torrent> Episondes { get; set; }

        public int SeasonNumber { get; set; }

        public string ShowName { get; set; }
        
        public int NumOfEpisodes { get; set; }

        public static ShowSeason GenerateSeason(string showName,int seasonNumber,int from,int to)
        {
            var s = new ShowSeason
                               {
                                   ShowName = showName,
                                   SeasonNumber = seasonNumber,
                                   NumOfEpisodes = to - from + 1,
                                   Episondes = new List<Torrent>()
                               };
            for (int i = from; i < to+1; i++)
            {
                s.Episondes.Add(Torrent.Generate(showName, seasonNumber, i));
            }
            return s;
        }

        public override string ToString()
        {
            return ShowName + ",Number:" + SeasonNumber + ",Episodes:" + NumOfEpisodes;
        }
        
    }
}
